package {
	import component.container.ConstraintLayoutContainer;
	
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	
	import obecto.core.FLApplication;
	import obecto.core.FLUIComponent;

	public class ConstraintLayoutSample extends FLApplication
	{
		private var container : ConstraintLayoutContainer;
		
		public function ConstraintLayoutSample()
		{
			super();
			
			stage.frameRate = 35;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
			
			container = new ConstraintLayoutContainer();
			
			this.addChild(container);
			
			var redChild : FLUIComponent = container.redChild;
			redChild.graphics.beginFill(0xFF0000);
			redChild.graphics.drawRect(0, 0, 100, 100);
			redChild.graphics.endFill();
			redChild.x = 0;
			redChild.width = 100;
			redChild.height = 100;

			var greenChild : FLUIComponent = container.greenChild;
			greenChild.graphics.beginFill(0xFF00);
			greenChild.graphics.drawRect(0, 0, 100, 100);
			greenChild.graphics.endFill();
			greenChild.x = 200;
			
			var blueChild : FLUIComponent = container.blueChild;
			blueChild.graphics.beginFill(0x0000FF);
			blueChild.graphics.drawRect(0, 0, 100, 100);
			blueChild.graphics.endFill();
			blueChild.x = 400;
			
			container.graphics.beginFill(0xFFFFFF);
			container.graphics.drawRect(0, 0, 800, 400);
			container.graphics.endFill();
			
			container.width = 800;
			container.height = 400;
		}
	}
}